{defun name="fullCatalogTree" list=$catTree.pages}
<ul>
{foreach from=$list item=node}
<li>
	{if $node.childs!='0'}
		<a href="#" onclick="fullCatalogTree('{$node.id}','category_{$node.id}','{$in_cats}');show('category_{$node.id}');return false;">{$node.title}</a> <span>{$node.firms_qnty}</span>
		<div id="category_{$node.id}" {if $node.inside_selected ne true}style="display:none;"{/if}>{fun name="fullCatalogTree" list=$node.sub}</div>
	{else}
		<input type="checkbox" name="item[cat_id][{$node.id}]" value="{$node.id}" id="category_{$node.id}" {if $node.selected}checked{/if}> <label for="category_{$node.id}">{$node.title}</label> <span>{$node.firms_qnty}</span>
	{/if}
</li>
{/foreach}
</ul>
{/defun}